1. Technology Field
The present invention relates to a method for transmitting and dispatching data stream. More particularly, the present invention relates to a method, a system and a controller thereof for transmitting and dispatching data stream to a storage device having a non-volatile memory and a smart card chip from a host.
2. Description of Related Art
As electronic wallets and pre-payments are gradually accepted by users, smart cards are widely used. The smart card is an integrated circuit chip having components such as a microprocessor, a card operating system, a security module and a memory etc. for performing a predetermined operation. The smart card provides functions of calculation, encryption, two-way communication and security, so that besides data storage, the smart card may provide a protection for the data stored therein. A subscriber identification module (SIM) card utilized in a cell phone applying a global system for mobile communication (GSM) is an application example of the smart card. However, since storage volumes of the smart cards are limited, memory cards with large volume are combined to the smart cards recently for increasing the storage volumes of the smart cards.
The memory card is a data storage device applying a NAND flash memory as a storage media thereof. The NAND flash memory has the advantages of writable, erasable, and may still maintain data during power-off. Moreover, the NAND flash memory is one of non-volatile memories which have the features of small size, fast accessing and lower power consumption, and during data erasing of the non-volatile memory, data stored therein may be erased block by block, and therefore the non-volatile memory also has the advantage of fast operating speed.
In a conventional technique, in application of combining the flash memory with the smart card, data transmitted to the smart card or the flash memory is distinguished by a specific command. However, a problem that hardware devices or drivers cannot support the specific command may occur. Moreover, in the conventional technique, whether or not data stream is complied with a command format of the smart card is judged by comparing type information of the transmitted data stream within the specific command. However, such method generally leads to a collision problem between a general file data and the command format of the smart card (i.e. the general file data is misjudged to be the data stream of the smart card).
Therefore, in the application of combining the flash memory with the smart card, a method for effectively judging whether or not the transmitted data is the smart card command is required to be developed.